{extend name="base" /}
{block name="body"}
<div class="layui-card">
	<div class="layui-card-body">
        <div class="layui-btn-group">
		    <a href="{:url('admin/course/categoryAdd')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加分类</a>
        </div>
		<table class="layui-table layui-form">
			<thead>
			<tr>
				<th width="30">ID</th>
				<th >分类名称</th>
				<th width="50">知识点</th>
				<th width="80">排序</th>
				<th width="340">操作</th>
			</tr>
			</thead>
			<tbody>
			{foreach name="list" item="v" empty="$empty"}
			<tr>
				<td>{$v.id}</td>
				<td>{$v.cname}</td>
				<td><a href="{:url('admin/course/knowledgeList', ['pid' => $v.id])}" class="ajax-iframe" data-width="800px" data-height="500px"><span class="layui-badge">{$v.knowledgePoints}</span></a></td>
				<td>
					<input type="text" name="sort_order" value="{$v.sort_order}" autocomplete="off" class="layui-input ajax-update" data-url="{:url('admin/course/categoryEdit', ['id' => $v.id])}">
				</td>
				<td>
					<a href="{:url('admin/course/categoryAdd', ['pid' => $v.id])}" class="layui-btn layui-btn-xs"><i class="fa fa-plus-circle"></i> 添加子分类</a>
					<a href="{:url('admin/course/knowledgeAdd', ['pid' => $v.id])}" class="layui-btn layui-btn-xs ajax-iframe" data-width="800px" data-height="500px"><i class="fa fa-plus-circle"></i> 添加知识点</a>
					<a href="{:url('admin/course/categoryEdit', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
					<a href="{:url('admin/course/categoryDel', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
				</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
	</div>
</div>
{/block}
